package com.fastexcel.index;

import com.fastexcel.FastExcel;
import com.fastexcel.entity.TestInfo;

import org.apache.log4j.Logger;
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
import java.io.IOException;
import java.util.List;

/**
 * @author peiyu
 */
public class DataIndex {
	private static final Logger LOG = Logger.getLogger(DataIndex.class);
	public DataIndex() {
		try {
			loadData(new FastExcel("data.xlsx"));
		} catch (InvalidFormatException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
    @SuppressWarnings("unused")
	private void loadData(FastExcel fastExcel) throws IOException, InvalidFormatException {
    	//test1
    	{
        	fastExcel.setSheetName("test1");
            List<TestInfo> tests = fastExcel.parse(TestInfo.class);
            if (null != tests && !tests.isEmpty()) {
                for (TestInfo myTest : tests) {
                }
            } else {
                LOG.debug("test1 没有结果");
            }      		
    	}
    	
    	{
    		
    		
    	}

    	//end
    	{
            fastExcel.close();	
    	}
        
    }
}
